package active.template;

public class AbstractLottery implements ILottery {
    @Override
    public String doLottery() {
        checkLotteryEvent();
        if (isExecute()) {
            getPrizePool();
        }
        String prize = getPrize();
        substractStockform();
        return prize;
    }

    /**
     * 检测抽象活动
     */
    public void checkLotteryEvent() {
        System.out.println("活动检测...");
    }

    /**
     * 获取奖池
     */
    public void getPrizePool() {
        System.out.println("获取奖池...");
    }

    /**
     * 获取奖品
     */
    public String getPrize() {
        System.out.println("获取奖品");
        return "111";
    }

    /**
     * 扣减库存
     */
    public void substractStockform() {
        System.out.println("扣减积分");
    }

    public boolean isExecute() {
        return true;
    }
}
